﻿<Window x:Class="InstantSpine.GUI.OptionsDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:p="clr-namespace:InstantSpine.GUI.Properties"
        Title="Global Settings" Height="280" Width="602"
        TextOptions.TextFormattingMode="Display" 
        ResizeMode="NoResize"
        Name="optionsWnd" WindowStartupLocation="CenterScreen">
    <StackPanel Margin="12,8">
        <Grid DataContext="{x:Static p:Settings.Default}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <!-- path to Ansys -->
            <TextBlock Grid.Row="0" Grid.Column="0" Text="Path to ANSYS binary" VerticalAlignment="Center" Margin="0,8"/>
            <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=pathToAnsys, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Margin="16,0,8,0" TextChanged="TextBox_TextChanged_1"/>
            <Button Name="btnBrowseForAnsys" Grid.Row="0" Grid.Column="2" Content="Browse" Padding="8, 2" Height="23" Click="btnBrowseForAnsys_Click"/>
            <!-- Ansys product string -->
            <TextBlock Grid.Row="1" Grid.Column="0" Text="ANSYS product string" VerticalAlignment="Center" Margin="0,8"/>
            <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=ansysProductString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Margin="16,0,8,0" TextChanged="TextBox_TextChanged_2"/>
            <!-- path to ParaSpine -->
            <TextBlock Grid.Row="2" Grid.Column="0" Text="Path to ParaSpine" VerticalAlignment="Center" Margin="0,8"/>
            <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=pathToParaSpine, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Margin="16,0,8,0" TextChanged="TextBox_TextChanged_3"/>
            <Button Name="btnBrowseForParaspine" Grid.Row="2" Grid.Column="2" Content="Browse" Padding="8, 2" Height="23" Click="btnBrowseForParaspine_Click"/>
            <!-- UI scaling -->
            <TextBlock Grid.Row="3" Grid.Column="0" Text="UI scaling" VerticalAlignment="Center" Margin="0,8"/>
            <Slider 
                Grid.Row="3" 
                Grid.Column="1" 
                VerticalAlignment="Center" 
                Margin="16,0,8,0" 
                Value="{Binding Path=uiScaleFactor}" 
                AutoToolTipPlacement="TopLeft"                 
                Maximum="4" 
                Minimum="0.5" 
                LargeChange="0.05" 
                SmallChange="0.05" 
                TickFrequency="0.05" 
                TickPlacement="BottomRight" 
                IsSnapToTickEnabled="True"
                AutoToolTipPrecision="2"/>
            <!-- slider tick labels -->
            <Grid Grid.Row="4" Grid.Column="1" Margin="-4,0,-14,0" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" HorizontalAlignment="Center">0.5</TextBlock>
                <TextBlock Grid.Column="1" HorizontalAlignment="Center">1.0</TextBlock>
                <TextBlock Grid.Column="2" HorizontalAlignment="Center">1.5</TextBlock>
                <TextBlock Grid.Column="3" HorizontalAlignment="Center">2.0</TextBlock>
                <TextBlock Grid.Column="4" HorizontalAlignment="Center">2.5</TextBlock>
                <TextBlock Grid.Column="5" HorizontalAlignment="Center">3.0</TextBlock>
                <TextBlock Grid.Column="6" HorizontalAlignment="Center">3.5</TextBlock>
                <TextBlock Grid.Column="7" HorizontalAlignment="Center">4.0</TextBlock>
            </Grid>
            <!-- text render mode -->
            <TextBlock Grid.Row="5" Grid.Column="0" Text="Text render mode" VerticalAlignment="Center" Margin="0,8"/>
            <StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="1">
                <ComboBox Height="22" Width="120" Margin="16,0,8,0" 
                          VerticalAlignment="Center"
                          HorizontalAlignment="Left"
                          SelectedValue="{Binding Path=textRenderMode, Mode=TwoWay}" 
                          SelectedValuePath="Content">
                    <ComboBoxItem>Ideal</ComboBoxItem>
                    <ComboBoxItem>Display</ComboBoxItem>
                </ComboBox>
                <TextBlock Text="Tip: Use “Ideal” mode for scale factors ≠ 1.0" Margin="0,0,8,0" VerticalAlignment="Center"/>
            </StackPanel>
        </Grid>
        <Grid Margin="0,24,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="auto" SharedSizeGroup="A"/>
                <ColumnDefinition Width="auto" SharedSizeGroup="A"/>
            </Grid.ColumnDefinitions>
            <Button Grid.Column="1" Margin="8,0,0,0" Name="btnSaveOptions" Content="OK" IsDefault="True" IsEnabled="{Binding OptionsAreValid}" MinWidth="80" Click="btnSaveOptions_Click" Padding="8,0" Height="23"/>
            <Button Grid.Column="2" Margin="8,0,0,0" Content="Cancel" IsCancel="True" Padding="8,0" MinWidth="80" Height="23"/>
        </Grid>        
    </StackPanel>    
</Window>
